home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Developer Kits / Arrange Developer Kit / Interfaces / ArrangeCallbacks.h next >
Encoding:
C/C++ Source or Header  |  1994-07-15  |  39.0 KB  |  1,059 lines  |  [TEXT/MPS ]

  1. #ifndef ARRANGECALLBACKS_H
  2. #define ARRANGECALLBACKS_H
  3.  
  4. #include "ArrangeModule.r.h"
  5. #include "Module.h"
  6.  
  7.  
  8. typedef struct FSSpec FSSpec;
  9.  
  10.  
  11. /* This flag controls code used to help debug plugin modules.  The affected
  12.  * code is mostly concerned with providing error messages when a module
  13.  * passes bad parameters into a callback function.
  14.  */
  15. #ifndef ArrangeModuleDebug
  16. #define ArrangeModuleDebug ModuleDebug
  17. #endif
  18.  
  19.  
  20. /* Error values returned from GetFieldDate and GetFieldNumber if the field
  21.  * isn't present.
  22.  */
  23. #define missingDateToken 0
  24. #define missingNumToken  -1E20
  25.  
  26.  
  27. // Types used in the Arrange-specific callback functions.
  28.  
  29. // An arDocumentPtr refers to a currently open document.
  30. class arDocument;
  31. typedef arDocument* arDocumentPtr;
  32.  
  33. typedef Integer  arNoteID;   // Identifies a note or system object
  34. typedef arNoteID arFieldID;  // Identifies a field definition
  35. typedef arNoteID arTypeID;   // Identifies a note type definition
  36. typedef arNoteID arTopicID;  // Identifies a topic, folder, or view
  37. typedef arNoteID arWindowID; // Identifies a document or browser window
  38.                                       // (including hidden windows).
  39.  
  40.  
  41. // Globally unique identifier for a note or other object
  42. struct arGlobalID { uInteger data[3]; };
  43.  
  44. typedef uInteger arDate;      // Seconds-since-1904 time format.
  45. typedef double   arFloat;      // 64-bit floating point value.
  46.  
  47. typedef Integer arListID;       // "handle" to a virtual list of arNoteIDs.
  48. typedef void*     arPathID;      // "handle" to an object specifying a path
  49.                                       // into the document's tree of notes.
  50.  
  51. typedef void*     arWalkCache; // "handle" to an internal data structure used
  52.                                       // to optimize WalkPath calls.
  53.  
  54. /* This enum is returned from GetPathInfo; it describes the different
  55.  * types of path.
  56.  */
  57. enum arPathType { ptShelf,         // Path is rooted in the shelf of some window
  58.                         ptTopic,         // Path is rooted in a topic (normal case)
  59.                         ptInvalid }; // Path is invalid or undefined
  60.  
  61.  
  62. /* This enum is returned from certain calls which perform operations on
  63.  * the document file.
  64.  */
  65. enum arFileOpResult
  66.     {
  67.     fOK,                // The operation completed successfully.
  68.     fSoftError,        // The operation failed in a recoverable manner; the
  69.                         // document is OK.
  70.     fFatalError     // The operation failed messily; document has been closed.
  71.     };
  72.  
  73.  
  74. /* This enum is used as a parameter to various searching functions, to control
  75.  * the direction of search.
  76.  */
  77. enum arDirCode { dForward, dBackward };
  78.  
  79.  
  80. // This enum defines various options for the FindText function.
  81. enum arSearchFlags { sfMatchWords    = 1,      // Match entire words only
  82.                             sfWrapAround    = 2,      // Wrap around at the end of the document
  83.                             sfCaseSensitive = 4,      // Case is significant
  84.                             sfTopicScope    = 8 }; // Only search within a single topic
  85.  
  86.  
  87. // This enum defines flags used by the GetNoteState and SetNoteState functions.
  88. enum arNoteState { nsNoteOpen         = 1,      // Note is "open" - fields are shown.
  89.                          nsNoteExpanded = 2 }; // Note is "expanded" - subnotes are shown.
  90.  
  91.  
  92. /* This enum is used for the function result from GetSelection.  It specifies
  93.  * the nature of the selected objects, and defines the contents of the various
  94.  * 'OUT' parameters.
  95.  */
  96. enum arSelType
  97.     {
  98.     stNone,              // There is no current selection (or the selection is not
  99.                           // of any of the types listed below).
  100.     
  101.     stNote,              // A single note is selected.  The note parameter specifies
  102.                           // the note.
  103.     
  104.     stField,              // A single field instance is selected.  The note and field
  105.                           // parameters specify the field.
  106.     
  107.     stText,              // Some text is selected in a field instance.  selStart and
  108.                           // selEnd give the (0-based) range of selected characters;
  109.                           // all other parameters are defined as for stField.  If
  110.                           // there is a text insertion point, selStart and selEnd
  111.                           // will be equal.
  112.     
  113.     stFieldContents, // The contents of some non-textual field (e.g. a picture
  114.                           // or file-reference field) are selected.  Parameters are
  115.                           // defined as for stField.
  116.     
  117.     stMultipleNotes, // More than one note is selected.  All parameters are
  118.                           // undefined, except for selStart, which is overloaded to
  119.                           // contain the number of notes in the selection.  Use
  120.                           // GetSelEntry to access the selected notes.
  121.                           // 
  122.                           // This value may sometimes be returned from GetSelection
  123.                           // even when only one note is selected, if the note is not
  124.                           // selected under a specific path.
  125.     
  126.     stMultipleFields // More than one field instance is selected.  All parameters
  127.                           // are undefined, except for selStart, which is overloaded
  128.                           // to contain the number of field instances in the selection.
  129.                           // Use GetSelEntry to access the selected fields.
  130.                           // 
  131.                           // This value may sometimes be returned from GetSelection
  132.                           // even when only one field is selected, if the field is
  133.                           // not selected under a specific path.
  134.     }; // SelType
  135.  
  136.  
  137. // This enum defines the flags parameter to various SetFieldText calls.
  138. enum arSetFieldFlags { sfDoParse            = 1, // Compute numeric value from text
  139.                                                             // (for SetFieldText)
  140.                               sfDoFormat        = 1, // Compute text from numeric value
  141.                                                            // (for SetFieldDate/Number)
  142.                               sfDisableModDate = 2, // Don't update last-mod field
  143.                               nullSFF = 0 };
  144.  
  145.  
  146. enum arFieldType
  147.      {
  148.     arFTCheckbox = 0,
  149.     arFTNumber   = 2,
  150.     arFTDateTime = 3,
  151.     arFTText     = 4,
  152.     arFTNoteLink = 6,
  153.     arFTPicture  = 7,
  154.     arFTPopup    = 9,
  155.     arFTTime     = 10,
  156.     arFTFileRef  = 12,
  157.     arFTNull         = 999999 // end-of-list marker used in CBPromptForField.
  158.     };
  159.  
  160.  
  161. // Types used for GetFieldStyle and SetFieldStyle.
  162.  
  163. /* Note that full justification (jFull) is not supported in Arrange 2.0.
  164.  * If you pass in a justification of jFull it will be converted to jLeft.
  165.  */
  166. enum arJustCode { jLeft, jCenter, jRight, jFull };
  167.  
  168. // Style info that applies to an entire field
  169. struct arFieldStyle    
  170.     {
  171.     Short versNum;            // Version number for this record (currently 1).
  172.     Short pad;                // Unused (always zero).
  173.     arJustCode just;        // Text justification
  174.     }; // arFieldStyle
  175.  
  176. // Style info that applies to a particular range of characters in a field
  177. struct arCharStyle
  178.     {
  179.     Short    font;            // Font ID.
  180.     Short    size;            // Font size.
  181.     Short    style;        // Text style ("face", in QuickDraw nomenclature).
  182.     RGBColor color;        // Foreground text color.
  183.     Integer  charCount;    // Number of characters to which this record applies,
  184.     Integer  reserved;    // Reserved for future use (always set to 0),
  185.     }; // arCharStyle
  186.  
  187.  
  188. // Constants for the type field of an arSortClause record.
  189. enum { sAscending, sDescending };
  190.  
  191. struct arSortClause
  192.     {
  193.     Integer   type;  // Clause type - currently supports sAscending and sDescending.
  194.     arFieldID field; // Field to sort on.
  195.     }; // arSortClause
  196.  
  197.  
  198. // Constants for the type field of an arFilterClause record.
  199. enum { fEquals,             // Field value equal to filter value.
  200.          fNotEqual,             // Field value not equal to filter value.
  201.          fLess,                 // Field value < filter value.
  202.          fGreater,             // Field value > filter value.
  203.          fLessOrEqual,         // Field value <= filter value.
  204.          fGreaterOrEqual,     // Field value >= filter value.
  205.          fTextMatch,         // Field value has filter value as a substring.
  206.          fNoTextMatch,         // Negation of foTextMatch.
  207.          fPrefix,             // Field value has filter value as a prefix.
  208.          fNoPrefix,             // Negation of foPrefix.
  209.          fAnyValue };         // Any field value matches (as long as
  210.                                  // the field is present).
  211.  
  212.  
  213. struct arFilterClause
  214.     {
  215.     Integer     type;        // Clause type - accepts constants from enum above.
  216.     arFieldID field;        // Field to match in, or nil to match any field.
  217.     char         text[128]; // Text to match or compare against; not used for fAnyValue.
  218.                                 // For Boolean fields, first byte holds the Boolean
  219.                                 // value (0 or 1).
  220.     arDate     date;        // Date to match or compare against; used instead of
  221.                                 // text value for date/time and time fields for the
  222.                                 // comparison  operators (fEquals, fNotEqual, fLess,
  223.                                 // fGreater, fLessOrEqual, and fGreaterOrEqual).
  224.     arFloat     number;        // Number to match or compare against; used similarly
  225.                                 // to the date value, but for number fields.
  226.     }; // arFilterClause
  227.  
  228.  
  229. // Flags parameter for filter calls
  230. enum arFilterFlags
  231.     {
  232.     ffInvert = 1,            // Invert the result of the filter - i.e. accept notes
  233.                                 // which otherwise would not be accepted, and vice-versa.
  234.     ffOrClauses = 2,        // OR, rather than AND, the result of the individual
  235.                                 // filter clauses.
  236.     ffSearchSubnotes = 4    // Search (recursively) through the subnotes of the
  237.                                 // specified target notes.
  238.     };
  239.  
  240.  
  241. // This enum is used as a parameter to LookupObjectName.
  242. enum arObjectClass { arNoteType,
  243.                             arField,
  244.                             arFolder,
  245.                             arTopic,
  246.                             arView,
  247.                             arFTV };        // Match on folders, topics, and views.
  248.  
  249.  
  250. /* Miscellaneous information about a note - used as a parameter to GetNoteInfo
  251.  * and SetNoteInfo.
  252.  */
  253. struct arNoteInfo
  254.     {
  255.     Short versNum;                // Version number for this record (currently 1).
  256.     Short pad;                    // Unused (always zero).
  257.     
  258.     arDate createDate;        // Date/time when note was created.
  259.     arDate lastModDate;        // Date/time when note was last edited.
  260.     char   creatorName[64]; // User name when note was created.
  261.     char   editorName [64]; // Used name when note was last edited.
  262.     
  263.     Integer appearances;    // Number of places in which the note appears;
  264.                                     // -1 indicates count has overflowed.
  265.     
  266.     Short  hilightColor;    // Index into the list of icon hilighting colors;
  267.                                     // 0 indicates no hilighting.
  268.     Short  hilightIcon;     // Index into the list of superimposed display
  269.                                     // images over the note icon; 0 indicates no
  270.                                     // superimposed image.  (Not implemented in Arrange 2.0.)
  271.     }; // arNoteInfo
  272.  
  273.  
  274. /* Miscellaneous information about a folder, topic, or view - used as a
  275.  * parameter to GetTopicInfo and SetTopicInfo.
  276.  */
  277. struct arTopicInfo
  278.     {
  279.     Short versNum;              // Version number for this record (currently 1).
  280.     Short pad;                  // Unused (always zero).
  281.     
  282.     arObjectClass type;      // Which type of object this is (arFolder, arTopic,
  283.                                   // or arView).
  284.     char      name[64];      // Folder, topic, or view name
  285.     arTypeID  defaultType; // Default note type; nil if none.  Only used for topics.
  286.     arTopicID parent;          // Parent topic (for views) or folder (for topics and
  287.                                   // folders).  Nil for the document-root folder.
  288.     }; // arTopicInfo
  289.  
  290.  
  291. /* Miscellaneous information about a note type - used as a parameter to
  292.  * GetTypeInfo and SetTypeInfo.
  293.  */
  294. struct arTypeInfo
  295.     {
  296.     Short versNum;                // Version number for this record (currently 1).
  297.     Short pad;                    // Unused (always zero).
  298.     
  299.     char name[64];                // Type name
  300.     }; // arTypeInfo
  301.  
  302.  
  303. /* Miscellaneous information about a field definition - used as a
  304.  * parameter to GetFieldInfo and SetFieldInfo.
  305.  */
  306. struct arFieldInfo
  307.     {
  308.     Short versNum;                // Version number for this record (currently 1).
  309.     Short pad;                    // Unused (always zero).
  310.     
  311.     char name[64];                // Field name
  312.     arFieldType type;            // Field's contents type.
  313.     Boolean sortPopupOrder; // Sort-in-menu-order flag (for popup fields).
  314.     arTypeID matchType;        // Note type to match on (for note-link fields).
  315.     arFieldID matchField;    // Field to match in (for note-link fields).
  316.     }; // arFieldInfo
  317.  
  318.  
  319. /* Miscellaneous information about a window - used as a parameter to
  320.  * GetWindInfo and SetWindInfo.
  321.  */
  322. struct arWindInfo
  323.     {
  324.     Short versNum;                // Version number for this record (currently 1).
  325.     Short pad;                    // Unused (always zero).
  326.     
  327.     char    name[64];            // Window name
  328.     Rect      bounds;            // Window's display bounds (in global coordinates).
  329.     Boolean visible;            // False for hidden windows.
  330.     }; // arWindInfo
  331.  
  332.  
  333. /* Miscellaneous information about an Arrange document - used as a parameter
  334.  * to GetDocInfo.
  335.  */
  336. struct arDocInfo
  337.     {
  338.     Short versNum;            // Version number for this record (currently 1).
  339.     Short pad;                // Unused (always zero).
  340.     
  341.     FSSpec    docFile;        // File where document is stored (for titled documents).
  342.     Boolean  titled;        // True if document is "titled", i.e. is associated with
  343.                                 // a visible disk file.  False for newly created (or
  344.                                 // imported) documents which have never been saved.
  345.     Boolean  changed;        // True if document contains unsaved changes.
  346.     Boolean  readOnly;   // True if the document is open read-only.
  347.     Boolean  hidden;        // True for documents which are open invisibly (i.e.
  348.                                 // not visible in a document window or the Windows
  349.                                 // menu).
  350.     }; // arDocInfo
  351.  
  352.  
  353. // This enum is used as a parameter to GetBuiltInObject.
  354. enum arBuiltInObject
  355.     {
  356.     // Folders and topics.
  357.     boRootFolder,            // Root of the folder hierarchy (user-visible).
  358.     boOrganizerFolder,    // "Organizer" folder (user-visible).
  359.     boSystemFolder,        // System folder.
  360.     boNoteTypesTopic,        // Topic containing all note type definitions.
  361.     boFieldsTopic,            // Topic containing all field definitions.
  362.     boTrashFolder,            // Trash folder (user-visible).
  363.     boTrashTopic,            // Trash topic.
  364.     
  365.     // Note types.
  366.     boFieldDefType,        // Note type for field definitions.
  367.     boNoteDefType,            // Note type for note definitions.
  368.     boTopicType,            // Note type for folders, topics, and views.
  369.     boFilterType,            // Note type for filter specifications.
  370.     boFormType,                // Note type for form specifications.
  371.     boWindowSettingsType,// Note type for window objects.
  372.     boMemoType,                // Built-in "Memo" note type (user-visible).
  373.     
  374.     // Windows.
  375.     boNoteCatalogWindow, // Window object for the Note Catalog.
  376.     boFieldCatalogWindow,// Window object for the Field Catalog.
  377.     
  378.     // Fields for user-created notes.
  379.     boDateCreatedField,    // "Date created" field (date/time) (user-visible).
  380.     boDateModifiedField,    // "Date modified" field (date/time) (user-visible).
  381.     boCreatorField,        // "Creator name" field (text) (user-visible).
  382.     boEditorField,            // "Last editor name" field (text) (user-visible).
  383.     boNoteTextField,        // "Note text" field (text) (user-visible).
  384.     boNotePictField,        // Builtin picture field (picture).
  385.     boSubnotesField,        // Subnotes field (note link).
  386.     
  387.     // Fields for system objects in general.
  388.     boNameField,            // Name field for field defs, folders/topics/views,
  389.                                 // and windows (text).
  390.     
  391.     // Fields for type definitions.
  392.     boNoteTypeNameField, // Name field for note definitions (text).
  393.     boNoteTypeIconField,    // Icon field for note definitions (picture).
  394.     
  395.     // Fields for field definitions.
  396.     boDefaultValueField, // Default value field for field definitions (defined
  397.                                 // as a text field; actually takes the same type as
  398.                                 // the field it inhabits).
  399.     
  400.     // Fields for folders, topics, and views.
  401.     boTopicContentsField,// Contents of a topic or view, or topic list in a
  402.                                 // folder (note link).
  403.     boTopicViewsField,    // View list for a topic or folder (note link).
  404.     
  405.     // Fields for window objects.
  406.     boWindowShelfField,    // Shelf contents for this window (note link).
  407.     
  408.     // Extra fields for the document-root folder.
  409.     boDocWindowsField        // List of window objects for this document (note link).
  410.     }; // arBuiltInObject
  411.  
  412.  
  413. // This enum defines the flags parameter for the DisplayNotify routine.
  414. enum arNotifyFlags
  415.     {
  416.     nfShowImmediately = 1, // Show dialog immediately, rather than waiting for
  417.                                   // 0.5 seconds to elapse
  418.     nfUseThermometer  = 2, // Include a progress indicator in the dialog
  419.     nfForFrontWindow  = 4  // Show the dialog on the same monitor as the front
  420.                                   // window, rather than on the menu-bar monitor
  421.     };
  422.  
  423.  
  424. /* This enum defines the flags parameter for the PromptForField and
  425.  * PromptForType functions.
  426.  */
  427. enum arChoiceDialogFlags
  428.     {
  429.     cdAllowAny       = 1, // Allow an "Any Field" or "Any Type" option
  430.     cdAllowBlank     = 2, // Allow a blank (nil) result
  431.     cdAllowDefineNew = 4  // Allow the user to create a new field or note type
  432.     }; // arChoiceDialogFlags
  433.  
  434.  
  435. /* This enum specifies the values to pass for the menuCode parameter to
  436.  * the AddMenu and AddMenuItem callbacks.
  437.  */
  438. enum arMenuID
  439.     {
  440.     // apple menu
  441.         mPluginAbout = 1,
  442.     mFile,
  443.         mPreferences,
  444.     mEdit,
  445.         mSelect,
  446.         mOutline,
  447.     mSearch,
  448.     mNotes,
  449.     mTopics,
  450.         mContents,
  451.     mViews,
  452.         mViewUpdate,
  453.     mText,
  454.         mFont,
  455.         mColor,
  456.     mWindows,
  457.     mFileRef,
  458.     mTools
  459.     }; // arMenuID
  460.  
  461.  
  462. /* This enum lists various locations in an Arrange document window where the
  463.  * user might click.  It is used as a parameter to a ClickHook function.
  464.  * Three of the ClickHook parameters - "note", "field", and "path", are only
  465.  * used for some of the enum values.  These are listed in parenthesis after
  466.  * the description of each enum value.
  467.  */
  468. enum arClickLocation
  469.     {
  470.     clNoteIcon,                    // A note icon                                (note,path)
  471.     clNoteControl,                // A note's fold control                (note,path)
  472.     clFieldName,                // A field label                            (note,field,path)
  473.     clFieldContents,            // The contents of a field                (note,field,path)
  474.     
  475.     clTimeDisplay,                // Time/date display in topic header
  476.     clTopicHeader,                // Rest of the topic header
  477.     clViewClose,                // Close box in the view header
  478.     clViewTrash,                // Trash can in the view header
  479.     clViewHeader,                // Rest of the view header
  480.     clCalendarHeader,            // Calendar header,
  481.     
  482.     clWindowTitle,                // Window title bar
  483.     clWindowClose,                // Window close box
  484.     clWindowZoom,                // Window zoom box
  485.     clWindowGrow,                // Window grow icon
  486.     
  487.     clContentsHeader,            // Contents header bar
  488.     clShelfHeader,                // Shelf header bar
  489.     clContentsName,            // topic/fldr name in Contents        (note)
  490.     clContentsIcon,            // topic/fldr icon in Contents        (note)
  491.     clShelfNote,                // name in Shelf                            (note)
  492.     clShelfIcon                    // icon in Shelf                            (note)
  493.     };
  494.  
  495.  
  496. // This enum is used as a parameter to the FieldHook hook function.
  497. enum arFieldAction
  498.     {
  499.     faEntry,           // The field's contents are being activated.
  500.     faExit,           // The field's contents have been deactivated.
  501.     faUpdate,       // The active field's contents are about to be written back
  502.                        // to the data layer.
  503.     faKeystroke,   // The user has typed a key in the text.
  504.     faBackspace,   // The user has typed the backspace or delete key.
  505.     faSelChange,   // The user has made a selection change (with the mouse or
  506.                        // arrow keys).
  507.     faEditCmd,       // The user has issued an editing command such as Cut, Paste,
  508.                        // or Clear.
  509.     faPopupChoice, // The user has made a choice in the field's popup menu
  510.                        // (Popup fields only)
  511.     faSetFormat,    // The hook has been chosen as the "format" for the field.
  512.     faUnsetFormat, // The hook has been deselected as the "format" for the field.
  513.     faAddAction,    // The hook has been added to the set of "actions" for the field.
  514.     faRemoveAction // The hook has been removed from the set of "actions" for the
  515.                         // field.
  516.     }; // arFieldAction
  517.  
  518.  
  519. // This enum is used as a parameter to the TopicHook hook function.
  520. enum arTopicAction
  521.     {
  522.     taSwitchTopic,            // The current topic/folder/view in the active window
  523.                                 // has changed
  524.     taSwitchWindow            // The active window has changed
  525.     }; // arTopicAction
  526.  
  527.  
  528. // This enum is used as a parameter to the FileHook hook function.
  529. enum arFileAction
  530.     {
  531.     faNewBlank,     // A "raw" new file has been created
  532.     faNew,         // A new document has been created from a stationery file
  533.     faOpen,         // An existing document or TAIL file has been opened
  534.     faClose,         // A document is about to be closed; an arHookResult of false
  535.                      // will cancel the operation and prevent it from being
  536.                      // closed.  Note that FileHooks are not called when a
  537.                      // document is closed due to an error condition (e.g. disk
  538.                      // error accessing the file).
  539.     faSave,         // An existing, titled file is about to be saved
  540.     faSaveAs,     // A document is about to be saved into a new file
  541.     faRevert         // A document has just been reverted to its saved state
  542.     }; // arFileAction
  543.  
  544.  
  545. // This enum is used as a parameter to the RegisterFieldProc callback function.
  546. enum arFPType { fpFormat,     // Register a field-format proc.
  547.                      fpAction }; // Register a field-action proc.
  548.  
  549.  
  550. // This enum is used as a parameter to the RegisterExportFormat callback function.
  551. enum arEFType { efSaveAs,     // Register a Save As format.
  552.                      efExport }; // Register an Export format.
  553.  
  554.  
  555. #ifdef __SC__
  556.     #define arClickLocation     long
  557.     #define arFieldAction       long
  558.     #define arTopicAction       long
  559.     #define arFileAction        long
  560.     #define arEFType            long
  561.     #define arFPType            long
  562.     #define arSetFieldFlags     long
  563.     #define arDirCode           long
  564.     #define arSearchFlags       long
  565.     #define arFilterFlags       long
  566.     #define arBuiltInObject     long
  567.     #define arObjectClass       long
  568.     #define arChoiceDialogFlags long
  569.     #define arNotifyFlags       long
  570.     
  571.     typedef long pARNoteState;
  572.     typedef long pARFieldType;
  573. #else
  574.     typedef arFieldType pARFieldType;
  575.     typedef arNoteState pARNoteState;
  576. #endif
  577.  
  578.  
  579. typedef Boolean arHookResult;
  580. typedef arHookResult (*ClickHook) ( ModuleParamBlock* pb, arClickLocation loc,
  581.                                                 Point where, pShort modifiers, pShort clickCount,
  582.                                                 arNoteID note, arFieldID field, arPathID path ENDP );
  583. typedef arHookResult (*KeyHook)     ( ModuleParamBlock* pb, pShort theChar, pShort key,
  584.                                                 pShort modifiers ENDP );
  585. typedef arHookResult (*MenuHook)  ( ModuleParamBlock* pb, Integer commandCode,
  586.                                                Integer commandParam, pShort modifiers ENDP );
  587. typedef arHookResult (*FieldHook) ( ModuleParamBlock* pb, arNoteID note,
  588.                                                arFieldID field, arFieldAction action,
  589.                                                const char* choiceText ENDP );
  590. typedef void           (*TopicHook) ( ModuleParamBlock* pb, arTopicID newTopic,
  591.                                                arWindowID newWindow, arTopicAction action ENDP );
  592. typedef void           (*TickHook)  ( ModuleParamBlock* pb ENDP );
  593. typedef arHookResult (*FileHook)  ( ModuleParamBlock* pb, arFileAction action ENDP );
  594. typedef arHookResult (*QuitHook)  ( ModuleParamBlock* pb ENDP );
  595. typedef void           (*AboutToMenuHook)(ModuleParamBlock* pb ENDP);
  596. typedef Integer      (*ImportHook)( ModuleParamBlock* pb, const FSSpec *file,
  597.                                               pShort fRefnum, Integer formatID,
  598.                                               pBoolean sniff, arTopicID destTopic ENDP );
  599. typedef Integer       (*ExportHook)( ModuleParamBlock* pb, const FSSpec *file,
  600.                                                pShort fRefnum, Integer formatID,
  601.                                                arEFType type, arTopicID srcTopic ENDP );
  602.  
  603.  
  604. /* This struct lists the callback functions for reading and writing data
  605.  * from field instances.
  606.  */
  607. struct DataCalls
  608.     {
  609.     Short vers;    // Version number for this record (currently 2).
  610.     Short pad;    // Unused (always 0).
  611.     
  612.     // Read calls
  613.     Integer         (*GetFieldTextLen)    (arNoteID note, arFieldID field ENDP);
  614.     Integer         (*GetFieldText)        ( arNoteID note, arFieldID field,
  615.                                                   Integer bufLen, OUT void* buffer ENDP );
  616.     arDate         (*GetFieldDate)        (arNoteID note, arFieldID field ENDP);
  617.     arFloat         (*GetFieldNumber)    (arNoteID note, arFieldID field ENDP);
  618.     
  619.     Integer         (*GetFieldListLen)    (arNoteID note, arFieldID field ENDP);
  620.     arNoteID         (*GetFieldListEntry)( arNoteID note, arFieldID field,
  621.                                                   Integer index ENDP );
  622.     OWN arListID (*GetFieldList)        (arNoteID note, arFieldID field ENDP);
  623.     
  624.     OWN PicHandle    (*GetFieldPict)    (arNoteID note, arFieldID field ENDP);
  625.     OWN Handle     (*GetFieldAlias)        (arNoteID note, arFieldID field ENDP);
  626.     
  627.     // Write calls
  628.     void (*SetFieldText)            ( arNoteID note, arFieldID field, const char* text,
  629.                                           Integer textLen, arSetFieldFlags flags ENDP );
  630.     void (*SetFieldDate)            ( arNoteID note, arFieldID field, arDate date,
  631.                                           arSetFieldFlags flags ENDP );
  632.     void (*SetFieldNumber)        ( arNoteID note, arFieldID field,
  633.                                           const arFloat *number, arSetFieldFlags flags ENDP );
  634.     void (*SetFieldList)            ( arNoteID note, arFieldID field, arListID list,
  635.                                           arSetFieldFlags flags ENDP );
  636.     void (*AddListFieldEntry)    ( arNoteID note, arFieldID field, Integer index,
  637.                                           arNoteID childNote, arSetFieldFlags flags ENDP );
  638.     void (*DeleteListFieldEntry)( arNoteID note, arFieldID field, arNoteID childNote,
  639.                                           arSetFieldFlags flags ENDP );
  640.     void (*MoveListFieldEntry)    ( arNoteID note, arFieldID field, arNoteID childNote,
  641.                                           Integer index, arSetFieldFlags flags ENDP );
  642.     void (*SetFieldPict)            ( arNoteID note, arFieldID field, PicHandle pict,
  643.                                           arSetFieldFlags flags ENDP );
  644.     void (*SetFieldAlias)        ( arNoteID note, arFieldID field, Handle alias,
  645.                                           arSetFieldFlags flags ENDP );
  646.  
  647.     // Functions added in version 2 of DataCalls record
  648.     void    (*ReplaceFieldText)( arNoteID note, arFieldID field,
  649.                                           Integer repStart, Integer repEnd,
  650.                                           const char* insText, arSetFieldFlags flags ENDP );
  651.     Integer (*GetFieldStyle)   ( arNoteID note, arFieldID field,
  652.                                           OUT arFieldStyle* fieldStyle,
  653.                                           Integer bufLen, OUT arCharStyle* charStyles ENDP );
  654.     void    (*SetFieldStyle)   ( arNoteID note, arFieldID field,
  655.                                          const arFieldStyle* fieldStyle,
  656.                                          Integer charStyleCount,
  657.                                          const arCharStyle* charStyles,
  658.                                           arSetFieldFlags flags ENDP );
  659.     }; // DataCalls
  660.  
  661.  
  662. /* This struct lists the callback functions for creating and destroying notes
  663.  * and managing their fields.
  664.  */
  665. struct NoteCalls
  666.     {
  667.     Short vers; // Version number for this record (currently 1).
  668.     Short pad;  // Unused (always 0).
  669.     
  670.     arNoteID        (*CreateNote)            ( arTypeID type, pBoolean doGather ENDP );
  671.     arNoteID        (*DuplicateNote)        ( arNoteID note, pBoolean doGather ENDP );
  672.     void            (*ConvertNote)            ( arNoteID note, arTypeID type,
  673.                                                   pBoolean doGather ENDP );
  674.     void            (*DestroyNote)            ( arNoteID note ENDP );
  675.     
  676.     void            (*AddField)                ( arNoteID note, arFieldID field,
  677.                                                   arFieldID nextField ENDP );
  678.     void            (*RemoveField)            ( arNoteID note, arFieldID field ENDP );
  679.     void            (*HideField)            ( arNoteID note, arFieldID field ENDP );
  680.     void            (*MoveField)            ( arNoteID note, arFieldID field,
  681.                                                   arFieldID nextField ENDP );
  682.     
  683.     Integer        (*CountNoteFields)    ( arNoteID note ENDP );
  684.     arFieldID    (*GetNoteField)        ( arNoteID note, Integer index ENDP );
  685.     Boolean        (*NoteHasField)        ( arNoteID note, arFieldID field,
  686.                                                   pBoolean onlyIfVisible ENDP );
  687.     
  688.     Boolean        (*NoteExists)            ( arNoteID note ENDP );
  689.     arTypeID        (*GetNoteType)            ( arNoteID note ENDP );
  690.     
  691.     void            (*GetNoteInfo)            ( arNoteID note, IO    arNoteInfo *info ENDP );
  692.     void            (*SetNoteInfo)            ( arNoteID note, const arNoteInfo *info ENDP );
  693.     }; // NoteCalls
  694.  
  695.  
  696. /* This struct lists the callback functions for inspecting and altering the
  697.  * selection.
  698.  */
  699. struct SelCalls
  700.     {
  701.     Short vers; // Version number for this record (currently 2).
  702.     Short pad;  // Unused (always 0).
  703.     
  704.     arWindowID    (*GetActiveWindow) ();
  705.     
  706.     arSelType    (*GetSelection)     ( OUT arNoteID *note, OUT arFieldID *field,
  707.                                                OUT Integer *selStart, OUT Integer *selEnd ENDP );
  708.     OWN arPathID(*GetSelPath)         ( );
  709.     void            (*GetSelEntry)         ( Integer index, OUT arNoteID *note,
  710.                                                OUT arFieldID *field,
  711.                                                 OUT arNoteID *parentNote ENDP );
  712.     
  713.     void            (*SelectObject)     ( arNoteID parent, arFieldID field,
  714.                                                arNoteID note, pBoolean doDeselect ENDP );
  715.     Boolean        (*ObjectIsSelected)( arNoteID parent, arFieldID field,
  716.                                                 arNoteID note ENDP );
  717.     Boolean        (*FlushSelection)     ( pBoolean alsoDrop ENDP );
  718.     
  719.     void            (*ShowPath)             ( arPathID path, pBoolean selectFlag,
  720.                                                Integer textSelStart, Integer textSelEnd ENDP );
  721.     
  722.     Integer        (*GetSelText)         ( Integer bufLen, OUT void* buffer,
  723.                                                 OUT Integer *selStart, OUT Integer *selEnd ENDP );
  724.     void            (*SetSelText)         ( const char* text, Integer textLen,
  725.                                                 Integer selStart, Integer selEnd ENDP );
  726.     
  727.     // Functions added in version 2 of SelCalls record
  728.     void      (*ReplaceSelText) ( const char* text, const char* undoName ENDP );
  729.     }; // SelCalls
  730.  
  731.  
  732. /* This struct lists the callback functions for searching, sorting, and
  733.  * filtering.
  734.  */
  735. struct SearchCalls
  736.     {
  737.     Short vers; // Version number for this record (currently 1).
  738.     Short pad;  // Unused (always 0).
  739.     
  740.     // Searching
  741.     Boolean (*NextAppearance)( IO arPathID path, arDirCode direction ENDP );
  742.     Boolean (*FindText)         ( IO arPathID path, arDirCode direction,
  743.                                         IO Integer *selStart, IO Integer *selEnd,
  744.                                         const char* searchString, arSearchFlags flags ENDP );
  745.     
  746.     // Filtering and sorting
  747.     OWN arListID (*FilterList)  ( arListID list, arTypeID matchType,
  748.                                             arFilterFlags flags, pShort clauseCount,
  749.                                             const arFilterClause* clauses ENDP );
  750.     OWN arListID (*FilterNotes) ( arTypeID type, arFilterFlags flags,
  751.                                             pShort clauseCount,
  752.                                             const arFilterClause* clauses ENDP );
  753.     OWN arListID (*SortNotes)   ( arListID list, pShort clauseCount,
  754.                                             const arSortClause* clauses ENDP );
  755.     }; // SearchCalls
  756.  
  757.  
  758. /* This struct lists the callback functions for creating and accessing
  759.  * system objects (i.e. topics, note type definitions, and so forth).
  760.  */
  761. struct SysObjCalls
  762.     {
  763.     Short vers; // Version number for this record (currently 1).
  764.     Short pad;  // Unused (always 0).
  765.     
  766.     // General calls
  767.     arNoteID         (*GetBuiltInObject)    ( arBuiltInObject whichObject ENDP );
  768.     arNoteID         (*LookupObjectName)    ( arObjectClass objClass, const char* name,
  769.                                                   pBoolean allowPartial ENDP );
  770.     
  771.     // Topic/folder/view calls
  772.     arTopicID     (*CreateTopic)        ( const char* name, arTopicID parent,
  773.                                                   arTopicID successor, pBoolean makeView ENDP );
  774.     arTopicID     (*CreateFolder)        ( const char* name, arTopicID successor ENDP );
  775.     void             (*UpdateView)            ( arTopicID view ENDP );
  776.     void             (*GetTopicInfo)        ( arTopicID topic, IO arTopicInfo *info ENDP );
  777.     void             (*SetTopicInfo)        ( arTopicID topic, const arTopicInfo *info ENDP );
  778.     
  779.     // Note type calls
  780.     arTypeID         (*CreateNoteType)    ( const char* name, pBoolean userVisible ENDP );
  781.     Integer         (*CountTypeInstances)( arTypeID type ENDP );
  782.     OWN arListID (*GetTypeInstances)    ( arTypeID type ENDP );
  783.     void             (*GetTypeInfo)        ( arTypeID type, IO arTypeInfo *info ENDP );
  784.     void             (*SetTypeInfo)        ( arTypeID type, const arTypeInfo *info ENDP );
  785.     
  786.     // Field calls
  787.     arFieldID     (*CreateField)        ( const char* name, pARFieldType dataType,
  788.                                                   pBoolean userVisible ENDP );
  789.     void             (*GetFieldInfo)        ( arFieldID field, IO arFieldInfo *info ENDP );
  790.     void             (*SetFieldInfo)        ( arFieldID field, const arFieldInfo *info ENDP );
  791.     
  792.     // Window calls
  793.     arWindowID     (*CreateWindow)        ( const char* name, const Rect *bounds ENDP );
  794.     arTopicID     (*GetCurrentTopic)    ( arWindowID window, pBoolean returnRoot ENDP );
  795.     Boolean         (*SetCurrentTopic)    ( arWindowID window, arTopicID topic,
  796.                                                   pBoolean useLastView ENDP );
  797.     Boolean         (*SelectWindow)        ( arWindowID window ENDP );
  798.     void             (*GetWindInfo)        ( arWindowID window, IO arWindInfo *info ENDP );
  799.     void             (*SetWindInfo)        ( arWindowID window, const arWindInfo *info ENDP );
  800.     }; // SysObjCalls
  801.  
  802.  
  803. /* This struct lists the callback functions for manipulating arListIDs and
  804.  * arPathIDs.
  805.  */
  806. struct ListCalls
  807.     {
  808.     Short vers; // Version number for this record (currently 1).
  809.     Short pad;  // Unused (always 0).
  810.     
  811.     // List access
  812.     Integer        (*GetListLen)        ( arListID list ENDP );
  813.     arNoteID        (*GetListEntry)    ( arListID list, Integer index ENDP );
  814.     Integer        (*GetListEntries)    ( arListID list, Integer index,
  815.                                               OUT arNoteID* buffer, Integer bufSize ENDP );
  816.     Integer        (*SearchList)        ( arListID list, arNoteID target ENDP );
  817.     
  818.     // List editing
  819.     void            (*SetListEntry)    ( IO arListID *list, Integer index,
  820.                                               arNoteID entry ENDP );
  821.     void            (*SetListEntries)    ( IO arListID *list, Integer index,
  822.                                               const arNoteID* entries, Integer count ENDP );
  823.     void            (*InsertListEntry)    ( IO arListID *list, Integer index,
  824.                                                   arNoteID entry ENDP );
  825.     void            (*InsertListEntries) ( IO arListID *list, Integer index,
  826.                                                   Integer count ENDP );
  827.     void            (*DeleteListEntries) ( IO arListID *list, Integer index,
  828.                                                   Integer count ENDP );
  829.     void            (*ResizeList)            ( IO arListID *list, Integer newSize ENDP );
  830.     
  831.     // Miscellaneous list operations
  832.     OWN arListID (*CreateList)     ( Integer length ENDP );
  833.     OWN arListID (*DupList)         ( OWN arListID list ENDP );
  834.     void             (*DisposeList) ( OWN arListID list ENDP );
  835.     
  836.     // Path access
  837.     arPathType    (*GetPathInfo)        ( arPathID path, OUT arNoteID *root ENDP );
  838.     Integer        (*GetPathLen)        ( arPathID path ENDP );
  839.     arNoteID        (*GetPathEntry)    ( arPathID path, Integer index ENDP );
  840.     
  841.     // Path manipulation
  842.     Boolean        (*PushPath)            ( arPathID path, arNoteID newEntry ENDP );
  843.     void            (*PopPath)            ( arPathID path ENDP );
  844.     Boolean        (*WalkPath)            ( arPathID path, arDirCode direction,
  845.                                               IO arWalkCache* cache ENDP );
  846.     void            (*DisposeWalkCache)( arWalkCache cache ENDP );
  847.     
  848.     // Miscellaneous path operations
  849.     OWN arPathID (*PathToTopic)    ( arTopicID topic, pBoolean atEnd ENDP );
  850.     Boolean         (*EqualPaths)        ( arPathID path1, arPathID path2 ENDP );
  851.     OWN arPathID (*DupPath)            ( arPathID path ENDP );
  852.     void             (*DisposePath)    ( arPathID path ENDP );
  853.     }; // ListCalls
  854.  
  855.  
  856. /* This struct lists the callback functions for manipulating the display
  857.  * state (scrolling, opening and closing notes, etc.).
  858.  */
  859. struct ViewCalls
  860.     {
  861.     Short vers; // Version number for this record (currently 1).
  862.     Short pad;  // Unused (always 0).
  863.     
  864.     arNoteState (*GetNoteState) ( arNoteID note, arNoteID parentNoteENDP );
  865.     void            (*SetNoteState) ( arNoteID note, arNoteID parentNote,
  866.                                             pARNoteState newState ENDP );
  867.     }; // ViewCalls
  868.  
  869.  
  870. /* This struct lists the callback functions for document-level operations
  871.  * (e.g. opening, closing and saving documents).
  872.  */
  873. struct DocCalls
  874.     {
  875.     Short vers; // Version number for this record (currently 1).
  876.     Short pad;  // Unused (always 0).
  877.     
  878.     arDocumentPtr    (*GetCurrentDoc)    ();
  879.     void                (*SetCurrentDoc)    (arDocumentPtr newDoc ENDP);
  880.     
  881.     Integer            (*CountOpenDocs)    ();
  882.     arDocumentPtr    (*GetIndexedDoc)    (Integer index ENDP);
  883.     arDocumentPtr  (*GetPrefsDoc)    ();
  884.     
  885.     void                (*GetDocInfo)        (IO arDocInfo *info ENDP);
  886.     
  887.     arDocumentPtr    (*NewDoc)            ( const FSSpec* stationeryFile,
  888.                                                   const char* title  ENDP);
  889.     arDocumentPtr    (*Open)                (const FSSpec* srcFile, pBoolean readOnly ENDP);
  890.     void                (*Close)                ();
  891.     
  892.     arFileOpResult    (*Save)                ();
  893.     arFileOpResult    (*SaveAs)            (const FSSpec* targetFile ENDP);
  894.     arFileOpResult    (*Revert)            ();
  895.     
  896.     Integer            (*GetGlobalData)  ( const char* name, Integer bufLen,
  897.                                                   OUT void* buffer  ENDP);
  898.     void                (*SetGlobalData)  ( const char* name, const void* data,
  899.                                                   Integer dataLen, pBoolean isText  ENDP);
  900.     
  901.     Boolean            (*BringCurDocToFront) ();
  902.     void                (*SetChangedFlag)         ();
  903.     void                (*SetupUndo)             ( const char* operationName,
  904.                                                         pBoolean setChangedFlag ENDP );
  905.     
  906.     void                (*OpenHiddenDoc)    ( const FSSpec* srcFile, pBoolean readOnly,
  907.                                                   OUT arDocumentPtr* doc,
  908.                                                   OUT pBoolean* closeWhenFinished ENDP );
  909.     }; // DocCalls
  910.  
  911.  
  912. /* This struct lists the callback functions for accessing and extending
  913.  * Arrange's import and export capabilities.
  914.  */
  915. struct IOCalls
  916.     {
  917.     Short vers; // Version number for this record (currently 1).
  918.     Short pad;  // Unused (always 0).
  919.     
  920.     Boolean    (*ImportTAIL) (const FSSpec* srcFile,    arTopicID destTopic ENDP);
  921.     Boolean    (*ExportTAIL) (const FSSpec* targetFile, arTopicID srcTopic  ENDP);
  922.     }; // IOCalls
  923.  
  924.  
  925. /* This struct lists the callback functions for calling and overriding Arrange
  926.  * commands.
  927.  */
  928. struct CmdCalls
  929.     {
  930.     Short vers; // Version number for this record (currently 1).
  931.     Short pad;  // Unused (always 0).
  932.     }; // CmdCalls
  933.  
  934.  
  935. /* This struct lists the callback functions for customizing the Arrange user
  936.  * interface.
  937.  */
  938. struct UICalls
  939.     {
  940.     Short vers; // Version number for this record (currently 1).
  941.     Short pad;  // Unused (always 0).
  942.     
  943.     void (*AddMenu)            ( const char* menuName, pShort menuCode,
  944.                                       Integer parentCode ENDP );
  945.     void (*AddMenuItem)        ( pShort menuCode, const char* itemName, pShort cmdChar,
  946.                                       Integer commandCode, Integer itemRefcon ENDP );
  947.     void (*DeleteMenuItem)    ( pShort menuCode, Integer commandCode,
  948.                                       Integer itemRefcon ENDP );
  949.     void (*SetMenuItem)        ( pShort menuCode, Integer commandCode,
  950.                                       Integer itemRefcon, const char* itemName,
  951.                                       pBoolean itemEnabled, pShort markChar,
  952.                                       pShort itemStyle ENDP );
  953.     
  954.     void (*SetClickHook)        ( ClickHook hook, uInteger refcon, pBoolean addHook ENDP );
  955.     void (*SetMenuHook)        ( MenuHook hook, uInteger refcon, pBoolean addHook,
  956.                                       Integer commandCode ENDP );
  957.     void (*SetKeyHook)       ( KeyHook hook, uInteger refcon, pBoolean addHook,
  958.                                       pShort charFilter, pShort keyFilter,
  959.                                       pShort modFilter ENDP );
  960.     void (*SetFieldHook)        ( FieldHook hook, uInteger refcon, pBoolean addHook,
  961.                                       arFieldID field ENDP );
  962.     void (*SetTopicHook)        ( TopicHook hook, uInteger refcon, pBoolean addHook ENDP );
  963.     void (*SetTickHook)        ( TickHook  hook, uInteger refcon, pBoolean addHook ENDP );
  964.     void (*SetFileHook)        ( FileHook  hook, uInteger refcon, pBoolean addHook ENDP );
  965.     void (*SetQuitHook)        ( QuitHook  hook, uInteger refcon, pBoolean addHook ENDP );
  966.     
  967.     void (*SetATMHook)        ( AboutToMenuHook hook, uInteger refcon,
  968.                                       pBoolean addHook ENDP );
  969.     
  970.     void (*RegisterImportFormat) ( const char* name, Integer formatID,
  971.                                              OSType* fileTypes, Integer fileTypeCount,
  972.                                              ImportHook hook, uInteger refcon ENDP );
  973.     
  974.     void (*RegisterExportFormat) ( const char* name, Integer formatID,
  975.                                              arEFType type, ExportHook hook,
  976.                                              uInteger refcon, OSType fileType,
  977.                                              OSType fileCreator ENDP );
  978.     
  979.     void (*RegisterFieldProc)( const char* name, Integer id, arFPType type,
  980.                                         Integer fieldTypes, FieldHook proc,
  981.                                         uInteger refcon ENDP );
  982.     Boolean (*TestFieldProc) ( arFieldID field, arFPType type, Integer procID ENDP );
  983.     }; // UICalls
  984.  
  985.  
  986. /* This struct lists the callback functions for displaying dialogs and
  987.  * progress indicators.
  988.  */
  989. struct DialogCalls
  990.     {
  991.     Short vers; // Version number for this record (currently 1).
  992.     Short pad;  // Unused (always 0).
  993.     
  994.     void        (*StopAlert)            ( const char* message ENDP );
  995.     Boolean    (*OKCancelAlert)        ( const char* message ENDP );
  996.     Boolean    (*PromptForString)    ( const char* prompt, IO char* string,
  997.                                               pShort maxLen, pBoolean numbersOnly ENDP );
  998.     
  999.     Boolean  (*PromptForField)    ( const char* prompt, IO arFieldID* field,
  1000.                                               const arFieldType* allowedTypes,
  1001.                                               arChoiceDialogFlags flags ENDP );
  1002.     Boolean  (*PromptForType)     ( const char* prompt, IO arTypeID* type,
  1003.                                               arChoiceDialogFlags flags ENDP );
  1004.     
  1005.     void        (*DisplayNotify)        (const char* message, arNotifyFlags flags ENDP);
  1006.     void        (*ClearNotify)            ();
  1007.     void        (*SetNotifyText)        (const char* newMessage ENDP);
  1008.     
  1009.     Boolean    (*TickNotify)            (Integer amountDone, Integer totalAmount ENDP);
  1010.     
  1011.     void        (*BackgroundTick)        ();
  1012.     }; // DialogCalls
  1013.  
  1014.  
  1015. /* This struct defines the Arrange-specific extensions to the standard set
  1016.  * of callback functions.
  1017.  */
  1018. class ArrangeCallbackTbl : public CallbackTbl
  1019.     {
  1020. public:
  1021.     ArrangeCallbackTbl();
  1022.     
  1023.     Short aVers;                    // Version number for Arrange callback extensions
  1024.                                         // (currently 1).
  1025.     Short aPad;                        // Unused (always 0).
  1026.           DataCalls*   data;   // Data manipulation calls.
  1027.           NoteCalls*   notes;  // Note manipulation calls.
  1028.           SelCalls*    sel;    // Selection access and manipulation.
  1029.           SearchCalls* search; // Search, filter, and sorting calls.
  1030.           SysObjCalls* sysObj; // Calls to manipulate system objects.
  1031.           ListCalls*     list;    // Calls to manipulate lists and paths.
  1032.           ViewCalls*   view;    // Calls to manipulate view state (scrolling,
  1033.                                         // opening/closing notes, etc.).
  1034.           DocCalls*    doc;    // Document-level operations.
  1035.           IOCalls*         io;        // Import and export customization.
  1036.           CmdCalls*     cmd;        // Command overriding, undo setup.
  1037.           UICalls*     ui;        // UI customization.
  1038.           DialogCalls* dlg;        // Dialogs and notification.
  1039.     
  1040. private:
  1041.     DataCalls    pData;
  1042.     NoteCalls    pNotes;
  1043.     SelCalls        pSel;
  1044.     SearchCalls    pSearch;
  1045.     SysObjCalls    pSysObj;
  1046.     ListCalls    pList;
  1047.     ViewCalls    pView;
  1048.     DocCalls        pDoc;
  1049.     IOCalls        pIO;
  1050.     CmdCalls        pCmd;
  1051.     UICalls        pUI;
  1052.     DialogCalls    pDlg;
  1053.     
  1054.     friend void InitSeg1Callbacks(IO ArrangeCallbackTbl& table);
  1055.     friend void InitSeg2Callbacks(IO ArrangeCallbackTbl& table);
  1056.     }; // ArrangeCallbackTbl
  1057.  
  1058.  
  1059. #endif // ifndef ARRANGECALLBACKS_H